package net.jkdmanager.common.api.model;

import java.io.Serializable;
import java.util.Map;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import java.util.HashMap;

@Entity
public class PluginConfig implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1788456314375418547L;
	
	@Id 
	@GeneratedValue
    private Long id;
	
	@Basic
	private String type;
	
	@ElementCollection(fetch=FetchType.EAGER)
	@JoinTable(name = "configProps", joinColumns = @JoinColumn(name = "id")) 
	@Column(name = "props", nullable = false) 
	private Map<String, String> properties = new HashMap<String, String>();
	
	public Long getId() {
		return id;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public String getType() {
		return type;
	}
	
	public void setProperties(Map<String, String> properties) {
		this.properties = properties;
	}
	
	public Map<String, String> getProperties() {
		return properties;
	}
	
}
